#@embedLayout()


#define content()

<form id="formId" method="post">
    <input type="hidden" name="role.role_id" id="roleId" value="#(role.roleId??)">
    <table class="table table-bordered">
        <tr>
            <td style="padding-top:15px;">#(_res.get('role.form.name')):</td>
            <td>
                <input type="text" id="roleName" name="role.role_name" class="easyui-textbox" data-options="required:true,validType:{length:[0,30],spacing:''}" value="#(role.role_name??)" #if(role != null) readonly="readonly" #end>
            </td>
        </tr>
        <tr>
            <td>#(_res.get('role.form.des')):</td>
            <td>
                <input type="text" class="easyui-textbox" id="des" name="role.des" data-options="validType:{length:[0,60],spacing:''}" value="#(role.des??)">
            </td>
        </tr>
    </table>
</form>

#end


#define css()


#end


#define js()

<script type="text/javascript">
    function datagrid_save(opr_type) {
        var url = '';
        if (opr_type == 'add') {
            url = contextRootPath + '/role/save';
        } else {
            url = contextRootPath + '/role/update';
        }

        $('#formId').form('submit', {
            url: url,
            onSubmit: function () {
                var flag = $(this).form('enableValidation').form('validate');
                if (flag) {
                    showProcess(true, '温馨提示', '正在提交数据...');
                }
                return flag;
            },
            success: function (data) {
                showProcess(false);
                var params = {};
                params.element = _datagrid;
                params.data = data;
                resultCallback(params);
            },
            onLoadError: function () {
                showProcess(false);
                $.messager.alert('温馨提示', '由于网络或服务器太忙，提交失败，请重试！');
            }
        });
    }

</script>

#end


